<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>


<body>
  <div id="app">
    <h2>url：{{web.url}}</h2>
    <h2>num：{{web.num}}</h2>
    实时渲染：<input type="text" v-model="web.url"><br>
    按下回车或离开光标点才渲染：<input type="text" v-model.lazy="web.url">
    <br>
    <!-- 有个bug在前面输入字符串就不会过滤 -->
    将输入框的值转换为数字型：<input type="text" v-model.number="web.num"><br>
    <br>
    <!-- 可以复合写 -->
    去除收尾空格：<input type="text" v-model.trim.lazy="web.num">
  </div>
  <script type="module">
    import { createApp, reactive } from './vue.esm-browser.js'
    createApp({
      setup() {
        const web = reactive({
          url: 'baidu.com',
          num: 10
        })
        return {
          web
        }
      }
    }).mount('#app')
  </script>
</body>

</html>